.class Lrexsee/keyboard/RexseeTouchBall$2;
.super Lrexsee/keyboard/TouchBallWidget$OnTouchBallMoveListener;
.source "RexseeTouchBall.java"


# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
    value = Lrexsee/keyboard/RexseeTouchBall;->show(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;IIIII)V
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x0
    name = null
.end annotation


# instance fields
.field X:I

.field Y:I

.field direction:I

.field final synthetic this$0:Lrexsee/keyboard/RexseeTouchBall;

.field private final synthetic val$accuracy:I

.field private final synthetic val$downKeycode:I

.field private final synthetic val$leftKeycode:I

.field private final synthetic val$rightKeycode:I

.field private final synthetic val$upKeycode:I


# direct methods
.method constructor <init>(Lrexsee/keyboard/RexseeTouchBall;IIIII)V
    .locals 2

    .prologue
    const/4 v1, 0x0

    .line 1
    iput-object p1, p0, Lrexsee/keyboard/RexseeTouchBall$2;->this$0:Lrexsee/keyboard/RexseeTouchBall;

    iput p2, p0, Lrexsee/keyboard/RexseeTouchBall$2;->val$upKeycode:I

    iput p3, p0, Lrexsee/keyboard/RexseeTouchBall$2;->val$downKeycode:I

    iput p4, p0, Lrexsee/keyboard/RexseeTouchBall$2;->val$leftKeycode:I

    iput p5, p0, Lrexsee/keyboard/RexseeTouchBall$2;->val$rightKeycode:I

    iput p6, p0, Lrexsee/keyboard/RexseeTouchBall$2;->val$accuracy:I

    .line 62
    invoke-direct {p0}, Lrexsee/keyboard/TouchBallWidget$OnTouchBallMoveListener;-><init>()V

    .line 63
    const/4 v0, -0x1

    iput v0, p0, Lrexsee/keyboard/RexseeTouchBall$2;->direction:I

    .line 64
    iput v1, p0, Lrexsee/keyboard/RexseeTouchBall$2;->X:I

    iput v1, p0, Lrexsee/keyboard/RexseeTouchBall$2;->Y:I

    return-void
.end method


# virtual methods
.method public run(II)V
    .locals 5
    .param p1, "x"    # I
    .param p2, "y"    # I

    .prologue
    const/4 v3, 0x0

    .line 119
    if-nez p1, :cond_1

    if-nez p2, :cond_1

    .line 120
    iput v3, p0, Lrexsee/keyboard/RexseeTouchBall$2;->X:I

    .line 121
    iput v3, p0, Lrexsee/keyboard/RexseeTouchBall$2;->Y:I

    .line 122
    const/4 v3, -0x1

    invoke-virtual {p0, v3}, Lrexsee/keyboard/RexseeTouchBall$2;->sendKey(I)V

    .line 140
    :cond_0
    :goto_0
    return-void

    .line 125
    :cond_1
    iget v3, p0, Lrexsee/keyboard/RexseeTouchBall$2;->X:I

    sub-int v1, p1, v3

    .line 126
    .local v1, "offsetX":I
    iget v3, p0, Lrexsee/keyboard/RexseeTouchBall$2;->Y:I

    sub-int v2, p2, v3

    .line 128
    .local v2, "offsetY":I
    invoke-static {v1}, Ljava/lang/Math;->abs(I)I

    move-result v3

    invoke-static {v2}, Ljava/lang/Math;->abs(I)I

    move-result v4

    if-lt v3, v4, :cond_3

    .line 129
    invoke-static {v1}, Ljava/lang/Math;->abs(I)I

    move-result v3

    iget v4, p0, Lrexsee/keyboard/RexseeTouchBall$2;->val$accuracy:I

    if-le v3, v4, :cond_0

    .line 130
    if-gez v1, :cond_2

    const/4 v0, 0x2

    .line 137
    .local v0, "newDirection":I
    :goto_1
    iput p1, p0, Lrexsee/keyboard/RexseeTouchBall$2;->X:I

    .line 138
    iput p2, p0, Lrexsee/keyboard/RexseeTouchBall$2;->Y:I

    .line 139
    invoke-virtual {p0, v0}, Lrexsee/keyboard/RexseeTouchBall$2;->sendKey(I)V

    goto :goto_0

    .line 131
    .end local v0    # "newDirection":I
    :cond_2
    const/4 v0, 0x3

    .restart local v0    # "newDirection":I
    goto :goto_1

    .line 133
    .end local v0    # "newDirection":I
    :cond_3
    invoke-static {v2}, Ljava/lang/Math;->abs(I)I

    move-result v3

    iget v4, p0, Lrexsee/keyboard/RexseeTouchBall$2;->val$accuracy:I

    if-le v3, v4, :cond_0

    .line 134
    if-gez v2, :cond_4

    const/4 v0, 0x0

    .restart local v0    # "newDirection":I
    goto :goto_1

    .line 135
    .end local v0    # "newDirection":I
    :cond_4
    const/4 v0, 0x1

    .restart local v0    # "newDirection":I
    goto :goto_1
.end method

.method public sendKey(I)V
    .locals 2
    .param p1, "newDirection"    # I

    .prologue
    .line 66
    iget v0, p0, Lrexsee/keyboard/RexseeTouchBall$2;->direction:I

    if-ne p1, v0, :cond_1

    .line 116
    :cond_0
    :goto_0
    return-void

    .line 67
    :cond_1
    iget v0, p0, Lrexsee/keyboard/RexseeTouchBall$2;->direction:I

    packed-switch v0, :pswitch_data_0

    .line 85
    :cond_2
    :goto_1
    :pswitch_0
    packed-switch p1, :pswitch_data_1

    goto :goto_0

    .line 87
    :pswitch_1
    const/4 v0, -0x1

    iput v0, p0, Lrexsee/keyboard/RexseeTouchBall$2;->direction:I

    goto :goto_0

    .line 71
    :pswitch_2
    iget v0, p0, Lrexsee/keyboard/RexseeTouchBall$2;->val$upKeycode:I

    if-lez v0, :cond_2

    iget-object v0, p0, Lrexsee/keyboard/RexseeTouchBall$2;->this$0:Lrexsee/keyboard/RexseeTouchBall;

    # getter for: Lrexsee/keyboard/RexseeTouchBall;->mBrowser:Lrexsee/core/browser/Browser;
    invoke-static {v0}, Lrexsee/keyboard/RexseeTouchBall;->access$0(Lrexsee/keyboard/RexseeTouchBall;)Lrexsee/core/browser/Browser;

    move-result-object v0

    iget-object v0, v0, Lrexsee/core/browser/Browser;->function:Lrexsee/core/browser/RexseeBrowser;

    iget v1, p0, Lrexsee/keyboard/RexseeTouchBall$2;->val$upKeycode:I

    invoke-virtual {v0, v1}, Lrexsee/core/browser/RexseeBrowser;->keyUp(I)V

    goto :goto_1

    .line 74
    :pswitch_3
    iget v0, p0, Lrexsee/keyboard/RexseeTouchBall$2;->val$downKeycode:I

    if-lez v0, :cond_2

    iget-object v0, p0, Lrexsee/keyboard/RexseeTouchBall$2;->this$0:Lrexsee/keyboard/RexseeTouchBall;

    # getter for: Lrexsee/keyboard/RexseeTouchBall;->mBrowser:Lrexsee/core/browser/Browser;
    invoke-static {v0}, Lrexsee/keyboard/RexseeTouchBall;->access$0(Lrexsee/keyboard/RexseeTouchBall;)Lrexsee/core/browser/Browser;

    move-result-object v0

    iget-object v0, v0, Lrexsee/core/browser/Browser;->function:Lrexsee/core/browser/RexseeBrowser;

    iget v1, p0, Lrexsee/keyboard/RexseeTouchBall$2;->val$downKeycode:I

    invoke-virtual {v0, v1}, Lrexsee/core/browser/RexseeBrowser;->keyUp(I)V

    goto :goto_1

    .line 77
    :pswitch_4
    iget v0, p0, Lrexsee/keyboard/RexseeTouchBall$2;->val$leftKeycode:I

    if-lez v0, :cond_2

    iget-object v0, p0, Lrexsee/keyboard/RexseeTouchBall$2;->this$0:Lrexsee/keyboard/RexseeTouchBall;

    # getter for: Lrexsee/keyboard/RexseeTouchBall;->mBrowser:Lrexsee/core/browser/Browser;
    invoke-static {v0}, Lrexsee/keyboard/RexseeTouchBall;->access$0(Lrexsee/keyboard/RexseeTouchBall;)Lrexsee/core/browser/Browser;

    move-result-object v0

    iget-object v0, v0, Lrexsee/core/browser/Browser;->function:Lrexsee/core/browser/RexseeBrowser;

    iget v1, p0, Lrexsee/keyboard/RexseeTouchBall$2;->val$leftKeycode:I

    invoke-virtual {v0, v1}, Lrexsee/core/browser/RexseeBrowser;->keyUp(I)V

    goto :goto_1

    .line 80
    :pswitch_5
    iget v0, p0, Lrexsee/keyboard/RexseeTouchBall$2;->val$rightKeycode:I

    if-lez v0, :cond_2

    iget-object v0, p0, Lrexsee/keyboard/RexseeTouchBall$2;->this$0:Lrexsee/keyboard/RexseeTouchBall;

    # getter for: Lrexsee/keyboard/RexseeTouchBall;->mBrowser:Lrexsee/core/browser/Browser;
    invoke-static {v0}, Lrexsee/keyboard/RexseeTouchBall;->access$0(Lrexsee/keyboard/RexseeTouchBall;)Lrexsee/core/browser/Browser;

    move-result-object v0

    iget-object v0, v0, Lrexsee/core/browser/Browser;->function:Lrexsee/core/browser/RexseeBrowser;

    iget v1, p0, Lrexsee/keyboard/RexseeTouchBall$2;->val$rightKeycode:I

    invoke-virtual {v0, v1}, Lrexsee/core/browser/RexseeBrowser;->keyUp(I)V

    goto :goto_1

    .line 90
    :pswitch_6
    iget v0, p0, Lrexsee/keyboard/RexseeTouchBall$2;->val$upKeycode:I

    if-lez v0, :cond_0

    .line 91
    iget-object v0, p0, Lrexsee/keyboard/RexseeTouchBall$2;->this$0:Lrexsee/keyboard/RexseeTouchBall;

    # getter for: Lrexsee/keyboard/RexseeTouchBall;->mBrowser:Lrexsee/core/browser/Browser;
    invoke-static {v0}, Lrexsee/keyboard/RexseeTouchBall;->access$0(Lrexsee/keyboard/RexseeTouchBall;)Lrexsee/core/browser/Browser;

    move-result-object v0

    iget-object v0, v0, Lrexsee/core/browser/Browser;->function:Lrexsee/core/browser/RexseeBrowser;

    iget v1, p0, Lrexsee/keyboard/RexseeTouchBall$2;->val$upKeycode:I

    invoke-virtual {v0, v1}, Lrexsee/core/browser/RexseeBrowser;->keyDown(I)V

    .line 92
    const/4 v0, 0x0

    iput v0, p0, Lrexsee/keyboard/RexseeTouchBall$2;->direction:I

    goto :goto_0

    .line 96
    :pswitch_7
    iget v0, p0, Lrexsee/keyboard/RexseeTouchBall$2;->val$downKeycode:I

    if-lez v0, :cond_0

    .line 97
    iget-object v0, p0, Lrexsee/keyboard/RexseeTouchBall$2;->this$0:Lrexsee/keyboard/RexseeTouchBall;

    # getter for: Lrexsee/keyboard/RexseeTouchBall;->mBrowser:Lrexsee/core/browser/Browser;
    invoke-static {v0}, Lrexsee/keyboard/RexseeTouchBall;->access$0(Lrexsee/keyboard/RexseeTouchBall;)Lrexsee/core/browser/Browser;

    move-result-object v0

    iget-object v0, v0, Lrexsee/core/browser/Browser;->function:Lrexsee/core/browser/RexseeBrowser;

    iget v1, p0, Lrexsee/keyboard/RexseeTouchBall$2;->val$downKeycode:I

    invoke-virtual {v0, v1}, Lrexsee/core/browser/RexseeBrowser;->keyDown(I)V

    .line 98
    const/4 v0, 0x1

    iput v0, p0, Lrexsee/keyboard/RexseeTouchBall$2;->direction:I

    goto :goto_0

    .line 102
    :pswitch_8
    iget v0, p0, Lrexsee/keyboard/RexseeTouchBall$2;->val$leftKeycode:I

    if-lez v0, :cond_0

    .line 103
    iget-object v0, p0, Lrexsee/keyboard/RexseeTouchBall$2;->this$0:Lrexsee/keyboard/RexseeTouchBall;

    # getter for: Lrexsee/keyboard/RexseeTouchBall;->mBrowser:Lrexsee/core/browser/Browser;
    invoke-static {v0}, Lrexsee/keyboard/RexseeTouchBall;->access$0(Lrexsee/keyboard/RexseeTouchBall;)Lrexsee/core/browser/Browser;

    move-result-object v0

    iget-object v0, v0, Lrexsee/core/browser/Browser;->function:Lrexsee/core/browser/RexseeBrowser;

    iget v1, p0, Lrexsee/keyboard/RexseeTouchBall$2;->val$leftKeycode:I

    invoke-virtual {v0, v1}, Lrexsee/core/browser/RexseeBrowser;->keyDown(I)V

    .line 104
    const/4 v0, 0x2

    iput v0, p0, Lrexsee/keyboard/RexseeTouchBall$2;->direction:I

    goto/16 :goto_0

    .line 108
    :pswitch_9
    iget v0, p0, Lrexsee/keyboard/RexseeTouchBall$2;->val$rightKeycode:I

    if-lez v0, :cond_0

    .line 109
    iget-object v0, p0, Lrexsee/keyboard/RexseeTouchBall$2;->this$0:Lrexsee/keyboard/RexseeTouchBall;

    # getter for: Lrexsee/keyboard/RexseeTouchBall;->mBrowser:Lrexsee/core/browser/Browser;
    invoke-static {v0}, Lrexsee/keyboard/RexseeTouchBall;->access$0(Lrexsee/keyboard/RexseeTouchBall;)Lrexsee/core/browser/Browser;

    move-result-object v0

    iget-object v0, v0, Lrexsee/core/browser/Browser;->function:Lrexsee/core/browser/RexseeBrowser;

    iget v1, p0, Lrexsee/keyboard/RexseeTouchBall$2;->val$rightKeycode:I

    invoke-virtual {v0, v1}, Lrexsee/core/browser/RexseeBrowser;->keyDown(I)V

    .line 110
    const/4 v0, 0x3

    iput v0, p0, Lrexsee/keyboard/RexseeTouchBall$2;->direction:I

    goto/16 :goto_0

    .line 67
    :pswitch_data_0
    .packed-switch -0x1
        :pswitch_0
        :pswitch_2
        :pswitch_3
        :pswitch_4
        :pswitch_5
    .end packed-switch

    .line 85
    :pswitch_data_1
    .packed-switch -0x1
        :pswitch_1
        :pswitch_6
        :pswitch_7
        :pswitch_8
        :pswitch_9
    .end packed-switch
.end method
